package com.software.abstractFactory;


/**
 * 对象工厂生产对象
 */
public class ShapeFactory extends AbstractFactory {
    //equalsIgnoreCase 忽略大小写的比较字符串
    public Shape getShape(String product) {
        if (product.equalsIgnoreCase("CIRCLE")) {
            return new Circle();
        }
        if (product.equalsIgnoreCase("RECTANGLE")) {
            return new Rectangle();
        }
        if (product.equalsIgnoreCase("SQUARE")) {
            return new Square();
        }
        return null;
    }

    @Override
    Color getColor(String color) {
        return null;
    }
}
